<div th:replace="~{ app :: layout ('修改密码', _, ~{::#main}, _) }" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6">
    <div id="main" class="container user-center my-2rem">
        <div class="row">
            <div class="col-lg-3">
                <div class="card shadow-sm">
                    <div class="card-body">
                        <div th:replace="~{user/_fragment :: #user-center-left}"></div>
                    </div>
                </div>
            </div>

            <div class="col-lg-9 mt-3 mt-lg-0">
                <div class="card shadow-sm">
                    <div class="card-header">修改密码</div>

                    <div class="card-body">
                        <form method="POST" action="#" th:action="@{/user/change-password}" th:object="${changePasswordDTO}">
                            <!-- 添加当前密码输入框 -->
                            <div class="row justify-content-center mb-3">
                                <div class="col-lg-6">
                                    <input placeholder="当前密码" th:field="*{currentPassword}" id="currentPassword" type="password" class="form-control" th:class="|form-control ${#fields.hasErrors('currentPassword') ? 'is-invalid' : ''}|" name="currentPassword" required autocomplete="current-password">
                                    <span th:if="${#fields.hasErrors('currentPassword')}" class="invalid-feedback" role="alert"><strong th:errors = "*{currentPassword}"></strong></span>
                                </div>
                            </div>

                            <div class="row justify-content-center mb-3">
                                <div class="col-lg-6">
                                    <input placeholder="新密码" th:field="*{password}" id="password" type="password" class="form-control" th:class="|form-control ${#fields.hasErrors('password') ? 'is-invalid' : ''}|" name="password" required autocomplete="new-password">
                                    <span th:if="${#fields.hasErrors('password')}" class="invalid-feedback" role="alert"><strong th:errors = "*{password}"></strong></span>
                                </div>
                            </div>

                            <div class="row justify-content-center mb-3">
                                <div class="col-lg-6">
                                    <input placeholder="确认密码" th:field="*{confirmPassword}" id="confirmPassword" type="password" class="form-control" th:class="|form-control ${#fields.hasErrors('confirmPassword') ? 'is-invalid' : ''}|" name="confirmPassword" required autocomplete="new-password">
                                    <span th:if="${#fields.hasErrors('confirmPassword')}" class="invalid-feedback" role="alert"><strong th:errors = "*{confirmPassword}"></strong></span>
                                </div>
                            </div>

                            <div class="row mb-0">
                                <div class="col-lg-6 offset-lg-3">
                                    <button type="submit" class="btn btn-primary">
                                        修改密码
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>